Action: Send a Message to REST Endpoint
In Cloudhouse Guardian (Guardian), you can configure actions to occur after certain events take place. For example, you can configure Guardian to automatically make an API call when an event occurs. Let's say you want to integrate Guardian with an internal system to store a login record of all Guardian users. You can do that using a REST endpoint action which makes an API call to your internal system each time a user logs in to Guardian.
Note: The following process assumes you have a REST endpoint already configured in Guardian. For more information, see REST Endpoint Integration.
Tip: For an overview of actions in Guardian, including more options available to choose from, see Actions.
Action Settings
When configuring a Send a Message to a REST Endpoint action, the following settings are presented:
Setting | Description |
---|---|
Action Name field | A unique name for the action. This name is how you will identify this action among all others configured in your Guardian instance, so ensure it is descriptive. For example, 'User Login API Call' and not simply 'User Login'. |
REST Endpoint Integration drop-down list |
A list of all REST endpoint integrations configured in your Guardian instance. When configuring a REST endpoint integration, you provide the endpoint URL, authentication credentials, and request method. From the drop-down list, select the REST endpoint you want to use for this action. |
Body field |
The request body to send to your chosen REST endpoint. What you include in your request body depends on what is required by the endpoint you're communicating with. Consult the external API's documentation to determine what needs to be included. Then, write the body of the REST call in JSON format as in the following example: Copy
The above example also makes use of variables. In Guardian, variables are pieces of text that are replaced with data relevant to a specific event. For example, |
These settings are configured when adding a new action, and they can also be edited at any time through the Actions tab () and select Edit. Once you have made your edits, click Done to save them.
Add a Send a Message to REST Endpoint Action
You can add a new Send a Message to REST Endpoint action from any saved view in your Guardian instance. Each saved view represents a specific event determined using a query on the Events page. The saved view you select during this configuration determines the corresponding event that triggers your new action. For more information, see Saved Views.
To add a Send a Message to REST Endpoint action, complete the following process:
Tip: For help completing any of the following fields, refer to their respective descriptions in the Action Settings table above.
-
Navigate to the Events tab (Control > Events).
-
Click the Saved Views button at the top of the page. The Saved Views side panel is displayed.
-
Select the event you want to trigger your new action. The saved view for that event is displayed.
-
Click the Actions tab to display all existing actions configured for this event.
-
Click the Add Action button. The Add New Action page is displayed.
-
Click Send a Message to REST Endpoint. The required fields are displayed.
-
Enter an Action Name.
-
Select an integration from the REST Endpoint Integration drop-down.
-
Enter a Body.
-
Click Done.
Now, a confirmation dialog is displayed and you are redirected to the Actions tab for your selected saved view. Here, you can view your new action. To disable, edit, or test the action, click the Ellipses () and select the appropriate option.